package com.sanen.flyer.factory;

import com.sanen.flyer.entity.hero.Hero;
import com.sanen.flyer.entity.hero.HuanYing;
import com.sanen.flyer.tool.ImageTool;

import java.awt.image.BufferedImage;

/**
 * 英雄机工厂
 * @author wsse
 * @date 2018-09-06 19:17
 */
public class HeroFactory {

    public static final int HERO_HUAN_YING=1;
    public static BufferedImage huanYing;

    public static Hero getHero(int type){
        switch (type){
            case HERO_HUAN_YING:
                return new HuanYing(getHuanYing());
        }
        return null;
    }

    /**
     * 加载图片huanYing
     */
    private static BufferedImage getHuanYing() {
        if (huanYing==null)huanYing= ImageTool.getImage("./image/aircraft/huanYing.png");
        return huanYing;
    }

}
